package rest


import (
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
	"layouts/services"
	//ginSwagger "github.com/swaggo/gin-swagger"

)

func Start() {
	g := gin.Default()
	g.Use(cors.Default())
	registerRouters(g)
	_ = g.Run("127.0.0.1:9080")
}

func registerRouters(g *gin.Engine) {
	//url := ginSwagger.URL("/swagger/doc.json") // The url pointing to API definition
	//g.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
	group := g.Group("service")
	group.GET("greetings", services.Greetings)
}